﻿using Gp.Scripts.Core;
using UnityEngine;
using UnityEngine.UI;

namespace Gp.Scripts.GUI
{
    public class PanelStartScreen : PanelStartScreenBase
    {
        protected override void OnEnter()
        {
            this.mTabHome_Animator.Play("Panel In");
        }

        protected override void OnExit()
        {
            this.mTabHome_Animator.Play("Panel Out");
        }

        protected override void OnClicked(Button button)
        {
            if (button == this.mBtnNewGame_Button)
            {
                // TODO YHK : 走语言包
                Global.Get<GUIManager>().OpenPopup<CommonPopup>(ConstPopupId.CommonPopup)
                    .Show("开始新游戏", "确定开始新游戏吗？", () =>
                    {
                        Global.Get<GUIManager>().JumpPanel(ConstPanelId.MainPanel);
                    });
            }
            else if (button == this.mBtnContinue_Button)
            {
                CreateWidget<PanelStartScreen_WidgetPlayStory>(mWidgetPlayStory_UIWidgetBehaviour);
            }
        }

        protected override void OnVisibleChanged(bool visible) { }
        protected override void OnFocusChanged(bool   got) { }
    }
}